#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org

START=50

start() {
	# CUPS tries to execute the backend through a user account other than
	# root, which creates some issues when accessing USB.
	# This chmod forces the backend to run as root from cups
	chmod 700 /usr/lib/cups/backend/usb

	mkdir -m 0755 -p /var/cache/cups
	mkdir -m 0755 -p /var/cups
	mkdir -m 0755 -p /var/spool/cups/tmp
	service_start /usr/sbin/cupsd
}

stop() {
	service_stop /usr/sbin/cupsd
}

reload() {
	service_reload /usr/sbin/cupsd
}
